let limit = 0
let set = false
let onfun:Function = ()=>{}
export const imgonLoad = (fun:Function)=>{
  onfun = fun
  if(limit == 0 && set)fun()
  if(!set) set = true
}
export const addlimit = ()=>{
  limit += 1
}
export const reducelimit = ()=>{
  limit-= 1
  imgonLoad(onfun)
}